//
//  WebViewViewController.m
//  一键车讯
//
//  Created by Rabbit on 14/11/6.
//  Copyright (c) 2014年 lanou.3g.com. All rights reserved.
//

#import "WebViewViewController.h"
#import "MainTain.h"

@interface WebViewViewController ()

@end

@implementation WebViewViewController

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
    }
    return self;
}
- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    UIWebView *webView = [[UIWebView alloc] initWithFrame:CGRectMake(0, -140, self.view.frame.size.width, self.view.frame.size.height + 230)];
    NSString *string = [self.mainTain.num substringToIndex:3];
    NSMutableString *str = [NSMutableString stringWithFormat:@"http://www.pcauto.com.cn/drivers/%@/%@.html", string, self.mainTain.num];  // 3. 接收传来的值
    NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:str] cachePolicy:NSURLRequestUseProtocolCachePolicy timeoutInterval:60];
    // 到达边界后不能滚动
    webView.scrollView.bounces = NO;
    // webView加载请求
    [webView loadRequest:request];
    [self.view addSubview:webView];
    [webView release];
    
    self.view.backgroundColor = [UIColor whiteColor];

}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
